package cn.wolfcode.trip.base.domain;

import com.alibaba.druid.support.json.JSONUtils;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Setter
@Getter
public class Hotel {

    public static final int BREAKFAST_NORMAL=0; //  正常
    public static final int BREAKFAST_RECOMMEND=1; //  推荐
    public static final int BREAKFAST_SOLDOUT=2; //  下架

    private Long id;

    private String title;  //大标题

    private String subTitle;  //小标题

    private String coverUrl;  //背景

    private Region place;  //所属地区

    private String introduce;  //酒店介绍

    private int state;  //状态


    public String getStateDisplay(){
        if(state == BREAKFAST_NORMAL){
            return "正常";
        }else if(state == BREAKFAST_RECOMMEND){
            return "推荐";
        }else if(state == BREAKFAST_SOLDOUT){
            return "下架";
        }
        return "";
    }

    public String getJsonString(){
        Map<String, Object> map = new HashMap<>();
        map.put("id",id);
        map.put("title",title);
        map.put("subTitle",subTitle);
        if(place != null){
            map.put("placeId",place.getId());
        }
        map.put("introduce",introduce);
        map.put("state",state);
        map.put("coverUrl",coverUrl);
        return JSONUtils.toJSONString(map);
    }

}